<link rel="stylesheet" href="../../public/style/css/main.css">
<script src="../../models/blog.js"></script>
<script src="../../routers/admin.js"></script>
<script src="../../routers/api.js"></script>
{% extends 'layout.html'%}
{% block title%}添加博客{%endblock%}
{% block body%}
{% block scripts%}
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
    $(function(){
        let $name =$("#name");
        let $categoryId =$("#categoryId");
        $("#submit").click(function(){
            $.post("/admin/category/change",{
                    categoryId :$categoryId.val(),
                    name:$name.val(),
                },
                function(result){
                    if(result.msg=="修改成功"){
                        alert("修改成功");
                    }
                    window.location.href='/admin/category?page=1'
                });
        });
    });
</script>
{%endblock%}
<form>
    <input id="categoryId" hidden value="{{category._id.toString()}}">
    <div class="form-group" >
        <h4>收藏夹</small></h4>
        {%for blog in blogs %}
        <button type="button" class="btn btn-success">标题：{{blog.title}}</button>
        {%endfor%}
    </div>
</form>

<button id="submit" type="button" class="btn btn-primary btn-lg btn-block">提交</button>
{% endblock%}